/**
 * Created by Administrator on 2017/12/4 0004.
 */

$(function(){
    console.log('%c 简历发送至282850486@qq.com-我们期待你的加入','color:red');
    console.log('%c 电话：0731-85151762','color:red');
    console.log('%c 偏偏似糖如蜜说来最动人','color:blue');
    console.log('%c 再怎么心如钢铁也成绕指柔','color:blue');
    console.log('%c 请为cc点赞','color:red');
    var ls=window.location.href;
    ls=ls.split('/');
    function browserRedirect() {

        var sUserAgent= navigator.userAgent.toLowerCase();

        var bIsIpad= sUserAgent.match(/ipad/i) == "ipad";

        var bIsIphoneOs= sUserAgent.match(/iphone os/i) == "iphone os";

        var bIsMidp= sUserAgent.match(/midp/i) == "midp";

        var bIsUc7= sUserAgent.match(/rv:1.2.3.4/i) == "rv:1.2.3.4";

        var bIsUc= sUserAgent.match(/ucweb/i) == "ucweb";

        var bIsAndroid= sUserAgent.match(/android/i) == "android";

        var bIsCE= sUserAgent.match(/windows ce/i) == "windows ce";

        var bIsWM= sUserAgent.match(/windows mobile/i) == "windows mobile";

        if (bIsIpad || bIsIphoneOs || bIsMidp || bIsUc7 || bIsUc || bIsAndroid || bIsCE || bIsWM) {

            window.location.href= '../phone/html/'+ls[ls.length-1];

        } else {



        }

    }
    browserRedirect();
    $('.content').after('<nav class="navbar navbar-inverse footnav cty">' +
        '<div class="container-fuild container-fuild-ds">' +
        '<div class="foottop">' +
        '<div class="row">' +
        '<div class="col-lg-6">' +
        '<img src="../img/jmyp-wx1.png" style="margin-left: 30px" alt="" class="wxclick">' +
        '<img  style="margin-left: 30px" src="../img/jmyp-qq.png" alt="">' +
        '<img src="../img/jmyp-xl.png"  style="margin-left: 30px" alt="">' +
        '</div>' +
        '<div class="col-lg-6 text-right">咨询热线：185 7065 7850<span class="zxbtn">我要咨询 ></span>' +
        '</div><div style="position: absolute;top: -60px;margin-left: 3px">' +
        '<img src="../img/wxerw.png" class="wxclick2" style="    width: 80px; display: none;z-index: 1;" alt=""></div>'+
        '</div>' +
        '</div></div><div class="footfoot">' +
        '<div class="row">' +
        '<p class="text-center">总部地址：长沙高新开发区文轩路27号麓谷企业广场 <span class="empty"></span> 电话：0731-85151762' +
        '<span class="empty"></span> 咨询邮箱：282850486@qq.com</p>' +
        '<p class="text-center">2005-2016 湖南聚媒优品有限公司 版权所有 湘ICP备17020348号-1</p>' +
        '</div></div></div></nav>');
        $('.content').before('<nav class="navbar navbar-default navbar-fixed-top">' +
            '<div class="container-fuild container-fuild-sg ">' +
            '<div class="navbar-header">' +
            '<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-7" aria-expanded="false">' +
            '<span class="sr-only">Toggle navigation</span>' +
            '<span class="icon-bar"></span>' +
            '<span class="icon-bar"></span>' +
            '<span class="icon-bar"></span>' +
            '</button>' +
            '<a class="navbar-brand" href="index.html"><img src="../img/logo.png" style="    margin-top: 13px;height: 50%;" alt=""></a>' +
            '</div> ' +
            '<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-7">' +
            '<ul class="nav navbar-nav topmenu">' +
            '<li><a href="index.html">首页</a></li>' +
            '<li><a href="about.html">关于</a></li>' +
            '<li><a href="service.html">服务</a></li>' +
            '<li><a href="caseStudy.html">案例</a></li>' +
            '<li><a href="personnel.html">人才</a></li>' +
            '<li><a href="contactUs.html">联络</a></li>' +
            '</ul></div>' +
            '</div></nav>');
    $('.wxclick').on('click',function () {
        $('.wxclick2').fadeToggle();
    })
    $('.zxbtn').on('click',function () {
        self.location='contactUs.html';
    });
    if(ls[ls.length-1]=='index.html'){
        $('.topmenu li:nth-child(1)').addClass('active');
    }
    if(ls[ls.length-1]=='about.html'){
        $('.topmenu li:nth-child(2)').addClass('active');
    }
    if(ls[ls.length-1]=='service.html'){
        $('.topmenu li:nth-child(3)').addClass('active');
    }
    if(ls[ls.length-1]=='caseStudy.html'){
        $('.topmenu li:nth-child(4)').addClass('active');
    }
    if(ls[ls.length-1]=='personnel.html'){
        $('.topmenu li:nth-child(5)').addClass('active');
    }
    if(ls[ls.length-1]=='contactUs.html'){
        $('.topmenu li:nth-child(6)').addClass('active');
    }
    $('.navbar.navbar-inverse.navbar-fixed-top').css('background','transparent');
    $('.navbar-inverse .navbar-nav > li > a' ).css('color','#222');
    $('.navbar-inverse .navbar-nav > .active > a').css({'background':'none','color':'#fff'});
    $(window).scroll(function(){
        if($(window).scrollTop()>100){
            $('.navbar.navbar-inverse.navbar-fixed-top').css('background','#222');
            $('.navbar-inverse .navbar-nav > li > a' ).css('color','#9d9d9d');
            $('.navbar-inverse .navbar-nav > .active > a').css({'background':'#080808','color':'#fff'})
        }else{
            $('.navbar.navbar-inverse.navbar-fixed-top').css('background','transparent');
            $('.navbar-inverse .navbar-nav > li > a' ).css('color','#222');
            $('.navbar-inverse .navbar-nav > .active > a').css({'background':'none','color':'#fff'})
        }
    });
})
$(document).ready(function () {

    $(".side ul li").hover(function () {

        $(this).find(".sidebox").stop().animate({ "width": "160px" }, 200).css({ "background": "#f32836" })

    }, function () {

        $(this).find(".sidebox").stop().animate({ "width": "40px" }, 200).css({ "background": "#f32836" })

    });

});



//回到顶部

function goTop() {

    $('html,body').animate({ 'scrollTop': 0 }, 2000);

}
